<template>
  <view class="">
    <!-- <uni-nav-bar title="详情"  fixed empty backgroundColor="#fff">
			<view class="flex align-center" slot="left">
				<tui-icon @click="navBack"  name="arrowleft"  :size="22"></tui-icon>
			</view>
		</uni-nav-bar> -->

    <t-header @back="navBack">详情</t-header>

    <view class="page" v-if="detail">
      <view class="tit">
        {{ detail.news_title }}
      </view>

      <view class="text-gray text-sm">
        <text></text>
        <text class="">{{ detail.news_time_text }}</text>
      </view>
      <view class="margin-top">
        <u-parse :content="detail.news_content"></u-parse>
      </view>

      <view class="text-sm margin-top text-gray">
        声明：我们力求信息真实、准确，文章提及内容仅供参考，不构成实质性投资建议，据此操作风险自担。
      </view>
    </view>
  </view>
</template>

<script setup>
  import { ref } from 'vue';
  import { getNewsDetail } from '@/api/index.js';
  import { onLoad } from '@dcloudio/uni-app';

  import uParse from '@/components/uni/uParse/src/wxParse.vue';
  import THeader from '@/components/views/t-header/index.vue'; // 头部组件

  const detail = ref(null);

  onLoad((t) => {
    getNewsDetail({
      news_id: t.id,
    }).then((res) => {
      detail.value = res.data;
    });
  });

  // 点击返回
  const navBack = () => {
    uni.navigateBack();
  };
</script>

<style lang="scss" scoped>
  .page {
    padding: 24rpx;
  }
  .tit {
    margin-bottom: 30rpx;
    font-family: PingFangSC, PingFang SC;
    font-weight: 700;
    font-size: 32rpx;
    color: #000000;
    line-height: 42rpx;
  }

  .text-gray {
    padding-bottom: 22rpx;
    border-bottom: 2rpx solid #ececec;
  }
</style>
